Skip to content

flashblocks: ensure cached stateroot is used even when hash validation comes from new_canonical_block notification#5

Merged
sduchesneau merged 3 commits into
firehose/0.xfrom
lastflash_before_full
May 29, 2026
Merged

flashblocks: ensure cached stateroot is used even when hash validation comes from new_canonical_block notification#5
sduchesneau merged 3 commits into
firehose/0.xfrom
lastflash_before_full

Conversation

@sduchesneau
Copy link
Copy Markdown

No description provided.

…n comes from new_canonical_block notification
@sduchesneau sduchesneau requested a review from maoueh May 29, 2026 17:50
@@ -1167,12 +1198,30 @@ where
}
let stored_clone = state.stored_flashblocks.clone();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for clone, can be pass by reference directly.

Comment on lines +1201 to +1217
// No bundle-changing work has happened since the last flashblock
// execution, so the live revision is the one the speculative
// precompute (if any) was launched against. A hit skips the slow
// synchronous state_root and is the key to beating reth's full-block
// FIRE BLOCK out the door.
let cached_state_root = Self::cached_state_root_for(
&state,
canonical_block_number,
state.bundle_revision,
);
if cached_state_root.is_some() {
debug!(
block = canonical_block_number,
revision = state.bundle_revision,
"canonical-driven is_final: using speculatively-precomputed state_root"
);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move that inside emission directly? Would be easier to see that block number is correct. checked for alignment if call was done later, no big deal though, I leave the decision to you.

@sduchesneau sduchesneau merged commit c83c385 into firehose/0.x May 29, 2026
2 checks passed
@sduchesneau sduchesneau deleted the lastflash_before_full branch May 29, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants